<?
  require_once 'dbinfo.php';
	$message    = "";
  if (isset($_POST['process'])) {
    $title = $_POST['title'];
    $date = $_POST['date'];
    $venue = $_POST['venue'];
    $description = $_POST['description'];

    $query = "INSERT INTO events (date, venue, title, description) 
    VALUES ('$date', '$venue', '$title', '$description')";
    
    $connect = mysqli_connect($databaseHost,$databaseUsername,$databasePassword,$databaseName) or die('<p class="error">[1]Unable to connect to the database server at this time.</p>');
    mysqli_query($connect, $query);
  }
?>

<html>
<style>
    .basictext {
        font-family: Arial, Helvetica, sans-serif; 
        font-size: 14px; color:#000066;
    }
    .errortext {
        font-family: Arial, Helvetica, sans-serif; 
        font-size: 14px; color:#C00000; font-weight: bold;
    }
    .left {
    width: 5%;
    float: left;
    text-align: right;
    }
    .right {
    width: 90%;
    margin-left: 20px;
    float: left;
    }
    
</style>
<body>
<form action="newevent.php" method="post">
	<? 
		if ($message != "") {
			print '<span class="errortext">'.
            $message . "</span>";
		} 
  ?>

  <div>
    <div class="left">
      <span class="basictext">Date:</span>
    </div>
    <div class="right">
      <input type="text" name="date" /><br />
    </div>
  </div>
  <div>
    <div class="left">
      <span class="basictext">Venue:</span>
    </div>
    <div class="right">
      <input type="text" name="venue" /><br />
    </div>
  </div>
  <div>
    <div class="left">
      <span class="basictext">Title:</span>
    </div>
    <div class="right">
      <input type="text" name="title" /><br />
    </div>
  </div>
  <div>
    <div class="left">
      <span class="basictext">Description:</span>
    </div>
    <div class="right">
      <textarea NAME="description" ROWS=10 COLS=50 ></textarea><br />
    </div>
  </div>
	<input type="hidden" name="process" value="1">
  <div>
    <div class="left">
        <input type="submit" value="Submit" />
    </div>	
	</div>
	<? 	
		if (isset($_POST['process'])) {
    
		}
	?>
</form> 
</body>
</html> 
